using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsServerTools._ManageData
{
    /// <summary>
    /// <para>Merge Layers</para>
    /// <para>Combines feature layers to create a single output layer.</para>
    /// <para>合并要素图层以创建单个输出图层。</para>
    /// </summary>    
    [DisplayName("Merge Layers")]
    public class MergeLayers : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MergeLayers()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The point, line, or polygon features or table to merge with the merge layer.</para>
        /// <para>要与合并图层合并的点、线或面要素或表。</para>
        /// </param>
        /// <param name="_merge_layer">
        /// <para>Merge Layer</para>
        /// <para>The point, line, or polygon features or table to merge with the input layer. The merge layer must contain the same feature type and time type as the input layer.</para>
        /// <para>要与输入图层合并的点、线或面要素或表。合并图层必须包含与输入图层相同的要素类型和时间类型。</para>
        /// </param>
        /// <param name="_output_name">
        /// <para>Output Name</para>
        /// <para>The name of the output feature service.</para>
        /// <para>输出要素服务的名称。</para>
        /// </param>
        public MergeLayers(object _input_layer, object _merge_layer, object _output_name)
        {
            this._input_layer = _input_layer;
            this._merge_layer = _merge_layer;
            this._output_name = _output_name;
        }
        public override string ToolboxName => "GeoAnalytics Server Tools";

        public override string ToolName => "Merge Layers";

        public override string CallName => "geoanalytics.MergeLayers";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _merge_layer, _output_name, _merging_attributes, _output, _data_store.GetGPValue()];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The point, line, or polygon features or table to merge with the merge layer.</para>
        /// <para>要与合并图层合并的点、线或面要素或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Merge Layer</para>
        /// <para>The point, line, or polygon features or table to merge with the input layer. The merge layer must contain the same feature type and time type as the input layer.</para>
        /// <para>要与输入图层合并的点、线或面要素或表。合并图层必须包含与输入图层相同的要素类型和时间类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Merge Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _merge_layer { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para>The name of the output feature service.</para>
        /// <para>输出要素服务的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output_name { get; set; }


        /// <summary>
        /// <para>Merging Attributes</para>
        /// <para><xdoc>
        ///   <para>A list of values that describe how fields from the merge layer are to be modified and matched with fields in the input layer. All fields from the input layer will be written to the output layer. If no merging attributes are defined, all fields from the merge layer will be written to the output layer.</para>
        ///   <para>If a field exists in one layer but not the other, the output layer will still contain two fields. The output field will contain null values for the input features that did not have the field. For example, if the input layer contains a field named TYPE but the merge layer does not contain TYPE, the output will contain TYPE, but its values will be null for all the features copied from the merge layer.</para>
        ///   <para>You can control how fields in the merge layer are written to the output layer using the following merge types:
        ///   <bulletList>
        ///     <bullet_item>Remove—The merge layer field will be removed from the output layer.  </bullet_item><para/>
        ///     <bullet_item>Rename—The merge layer field will be renamed in the output. You cannot rename a field from the merge layer to a field from the input layer. To make field names equivalent, use the match option.  </bullet_item><para/>
        ///     <bullet_item>Match—The merge layer field is renamed and matched to a field from the input layer. For example, the input layer has a field named CODE and the merge layer has a field named STATUS. You can match STATUS to CODE, and the output will contain the CODE field with values of the STATUS field used for features copied from the merge layer. Type casting is supported for numeric values. Matching numeric fields to string fields is not supported.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>描述如何修改合并图层中的字段并将其与输入图层中的字段匹配的值列表。输入层中的所有字段都将写入输出层。如果未定义合并属性，则合并图层中的所有字段都将写入输出图层。</para>
        ///   <para>如果一个图层中存在一个字段，而另一个图层中不存在，则输出图层仍将包含两个字段。输出字段将包含没有该字段的输入要素的空值。例如，如果输入图层包含名为 TYPE 的字段，但合并图层不包含 TYPE，则输出将包含 TYPE，但对于从合并图层复制的所有要素，其值将为空。</para>
        /// <para>您可以使用以下合并类型控制如何将合并图层中的字段写入输出图层：
        ///   <bulletList>
        ///     <bullet_item>移除—将从输出图层中移除合并图层字段。</bullet_item><para/>
        ///     <bullet_item>重命名 - 将在输出中重命名合并图层字段。您无法将合并图层中的字段重命名为输入图层中的字段。若要使字段名称等效，请使用 match 选项。 </bullet_item><para/>
        ///     <bullet_item>匹配 - 合并图层字段将被重命名并匹配到输入图层中的字段。例如，输入图层有一个名为 CODE 的字段，合并图层有一个名为 STATUS 的字段。您可以将 STATUS 与 CODE 匹配，输出将包含 CODE 字段，其中包含用于从合并图层复制的要素的 STATUS 字段的值。数值支持类型转换。不支持将数值字段与字符串字段匹配。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Merging Attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _merging_attributes { get; set; } = null;


        /// <summary>
        /// <para>Output</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output { get; set; }


        /// <summary>
        /// <para>Data Store</para>
        /// <para><xdoc>
        ///   <para>Specifies the ArcGIS Data Store where the output will be saved. The default is Spatiotemporal big data store. All results stored in a spatiotemporal big data store will be stored in WGS84. Results stored in a relational data store will maintain their coordinate system.</para>
        ///   <bulletList>
        ///     <bullet_item>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</bullet_item><para/>
        ///     <bullet_item>Relational data store—Output will be stored in a relational data store.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将保存输出的 ArcGIS Data Store。默认值为 Spatiotemporal 大数据存储。存储在时空大数据存储中的所有结果都将存储在 WGS84 中。存储在关系数据存储中的结果将保留其坐标系。</para>
        ///   <bulletList>
        ///     <bullet_item>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>关系数据存储 - 输出将存储在关系数据存储中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Data Store")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _data_store_value _data_store { get; set; } = _data_store_value._SPATIOTEMPORAL_DATA_STORE;

        public enum _data_store_value
        {
            /// <summary>
            /// <para>Spatiotemporal big data store</para>
            /// <para>Spatiotemporal big data store—Output will be stored in a spatiotemporal big data store. This is the default.</para>
            /// <para>时空大数据存储 - 输出将存储在时空大数据存储中。这是默认设置。</para>
            /// </summary>
            [Description("Spatiotemporal big data store")]
            [GPEnumValue("SPATIOTEMPORAL_DATA_STORE")]
            _SPATIOTEMPORAL_DATA_STORE,

            /// <summary>
            /// <para>Relational data store</para>
            /// <para>Relational data store—Output will be stored in a relational data store.</para>
            /// <para>关系数据存储 - 输出将存储在关系数据存储中。</para>
            /// </summary>
            [Description("Relational data store")]
            [GPEnumValue("RELATIONAL_DATA_STORE")]
            _RELATIONAL_DATA_STORE,

        }

        public MergeLayers SetEnv(object extent = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}